﻿using System;
using System.Collections;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {

            SortedList sortlist = new SortedList();

            sortlist.Add(1, "鸭子");
            sortlist.Add(2, "兔子");
            sortlist.Add(3, "鹅");
            sortlist.Add(4, "鸡");

            Console.WriteLine("选择你喜欢的动物：");
            int id = int.Parse(Console.ReadLine());
            bool am = sortlist.ContainsKey(id);
            if (am)
            {
                string animal = sortlist[id].ToString();
                Console.WriteLine("含泪两大碗？:{0}", animal);
            }
            else
            {
                Console.WriteLine("**那么可爱，不舍得吃");
            }
            Console.WriteLine();
            Console.WriteLine("清蒸，红烧，麻辣？:");
            foreach (DictionaryEntry i in sortlist)
            {
                int key = (int)i.Key;
                string value = i.Value.ToString();
                Console.WriteLine("流着泪:{0},真香:{1}", key, value);

            }
        }

    }
}